home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98b.txt
/
000047_icon-group-sender _Mon Jun 1 13:51:26 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
3KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id NAA25760
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 1 Jun 1998 13:51:25 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA06925; Mon, 1 Jun 1998 13:51:19 -0700
Date: Mon, 1 Jun 1998 12:47:16 -0500 (CDT)
From: Chris Tenaglia <cdt@post.its.mcw.edu>
To: icon-group@optima.CS.Arizona.EDU
Subject: disp.icn
Message-Id: <Pine.SOL.3.96.980601124103.8745A-100000@post.its.mcw.edu>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 1993
>From cdt@post.its.mcw.edu Mon Jun 1 12:38:06 1998
Status: O
X-Status:
Newsgroups:
Date: Mon, 1 Jun 1998 12:38:06 -0500 (CDT)
From: Chris Tenaglia <cdt@post.its.mcw.edu>
To: icon-group@cs.arizona.edu
Subject: disp.icn
Fcc: sentmail
Message-ID: <Pine.SOL.3.96.980601123411.6757A@post.its.mcw.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Here's a little snippet I found useful. We use mostly PCs
but the unix servers still have apps in Xwindows. As we
log in from various PCs, the DISPLAY variable in the unix
shell needs to change. So here is disp.icn
Environment solaris/unix. c-shell. telnet session.
After I compile it onto the path I put this line in .cshrc
setenv DISPLAY `disp`
Note : If you have other telnet sessions from other computers
simultaneously, you may get their display instead. You also
must the X-server running on your PC/MAC/Xterm as appropriate.
Tested on : SunOS xxx 5.5.1 Generic_103640-14 sun4m sparc
SUNW,SPARCstation-5
Enjoy.
####################################################################
#
# file : disp.icn
# desc : determine the "DISPLAY" variable for Xwindows in a solaris
# unix session
# use : disp (called by .login or .cshrc)
#
# update by what
# 01-jun-1998 tenaglia initial write
#
procedure main()
com1 := "env >disp.tmp"
system(com1)
in := open("disp.tmp")
every line := !in do if match("USER",line) then self := parse(line,'= ')[2]
close(in)
com2 := "who >disp.tmp"
system(com2)
in := open("disp.tmp")
every line := !in do if match(self,line) then display := parse(line,' \t')[6]
close(in)
remove("disp.tmp")
write(display[2:-1],":0.0")
end
#
# parse a string into a list with respect to a delimiter
#
procedure parse(line,delims)
static chars
chars := &cset -- delims
tokens := []
line ? while tab(upto(chars)) do put(tokens,tab(many(chars)))
return tokens
end
#################################################################